home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 120
/
Vol 120.iso
/
games
/
space_bo.swf
/
scripts
/
frame_38
/
DoAction.as
Wrap
Text File
|
2010-11-09
|
3KB
|
135 lines
function setRikonPositions()
{
i = 1;
while(i <= 15)
{
do
{
check = 0;
rikonPos[i] = -600 - random(14000);
j = 1;
while(j <= 15)
{
rikonGap = Math.abs(Number(rikonPos[j] - rikonPos[i]));
if(j != i and rikonGap < 600)
{
check = 1;
}
j++;
}
}
while(check == 1);
i++;
}
do
{
check = 0;
i = 1;
while(i <= 14)
{
if(rikonPos[i + 1] > rikonPos[i])
{
check = 1;
temp = rikonPos[i];
rikonPos[i] = rikonPos[i + 1];
rikonPos[i + 1] = temp;
}
i++;
}
}
while(check == 1);
}
function setTimer()
{
if(timeLeft > 0)
{
timeLeft--;
menu.timer.gotoAndStop(int(100 - timeLeft / 30));
menu.distanceMeter.gotoAndStop(int(rikPlanetPos / -150));
}
else
{
rikYpos = rik._y;
gotoAndStop("lose");
}
}
function moveShip()
{
if(ship._x > 275)
{
ship._x += speed;
pod._x = ship._x + 81;
}
else
{
rikEnterShip = 1;
speed = 0;
ship._x = 275;
pod._x = 356;
rikYMove = (310 - rik._y) / 40;
rikXMove = 5.5;
rikYpos = rik._y;
rikStatus = "SHIP";
rik.anim.gotoAndStop("right");
gotoAndStop("win");
play();
}
}
function shootBullet(shootX)
{
i = 1;
while(i <= 9)
{
if(bulletActive[i] == 0)
{
riciclesCollected--;
bulletActive[i] = 1;
eval("bullet" + i)._x = 125;
eval("bullet" + i)._y = rik._y + 30;
eval("bullet" + i).shootX = shootX;
eval("bullet" + i).gotoAndPlay(2);
i = 10;
}
i++;
}
}
_quality = "BEST";
sfxLoop = new Sound();
sfxLoop.attachSound("sfxLoop");
sfxLoop.start(0,10000);
sfxLoop.setVolume(100);
loopVol = 100;
signActive = 1;
sign.gotoAndPlay(1);
speed = 0;
boost = 0;
lastKeyDown = "RIGHT";
rikStatus = "FLY";
flameLevel = 10;
rikPlanetPos = 0;
ship._x = 750;
pod._x = 831;
rik._x = 100;
rikShadow._x = 120;
riciclesCollected = 10;
timeLeft = 3000;
rikEnterShip = 0;
alienKill = 0;
alienBonusKill = 0;
sign.gotoAndPlay(1);
pod.gotoAndStop(1);
rik.anim.gotoAndStop("landed");
rikonPos = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
setRikonPositions();
bulletActive = new Array();
i = 1;
while(i <= 9)
{
bulletActive[i] = 0;
duplicateMovieClip("bullet","bullet" + i,16384 + (i + 10));
i++;
}
stop();